home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3
/
libspool.z
/
libspool
Wrap
Text File
|
1998-10-30
|
7KB
|
133 lines
LLLLIIIIBBBBSSSSPPPPOOOOOOOOLLLL((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo LLLLIIIIBBBBSSSSPPPPOOOOOOOOLLLL((((3333))))
LLLLIIIIBBBBRRRRAAAARRRRYYYY DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_l_i_b_s_p_o_o_l provides a C Language application programming interface (API) to
the UNIX printer spooling system. There are two common UNIX printer
spooling systems, System V and BSD. While both of these spooling systems
provide essentially the same capabilities, each has its own command set
and neither provides a C API. _l_i_b_s_p_o_o_l provides a single API to both
spooling systems. Spooling functions provided by _l_i_b_s_p_o_o_l include print
job submittal and cancel, print queue reading and control.
LLLLIIIIBBBBRRRRAAAARRRRYYYY AAAACCCCCCCCEEEESSSSSSSS
A program that calls _l_i_b_s_p_o_o_l functions must include the _s_p_o_o_l._h header
file located in the ////uuuussssrrrr////iiiinnnncccclllluuuuddddeeee directory. In addition, the program must
link with the _l_i_b_s_p_o_o_l._a library located in ////uuuussssrrrr////lllliiiibbbb. The link line would
look like:
... -lspool ...
FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
SSSSppppoooooooolllliiiinnnngggg SSSSyyyysssstttteeeemmmm SSSSeeeelllleeeeccccttttiiiioooonnnn
SLSetSpooler
SLGetSpooler
PPPPrrrriiiinnnntttteeeerrrr IIIInnnnffffoooorrrrmmmmaaaattttiiiioooonnnn
SLGetPrinterList
SLGetPrinterInfo
SLGetDefPrinterName
OOOOppppttttiiiioooonnnn MMMMaaaannnnaaaaggggeeeemmmmeeeennnntttt
SLGetPrinterSettings
SLSysVGetSpoolerOptions
SLSysVGetPrinterOptions
SLSysVSaveSpoolerOptions
SLSysVSavePrinterOptions
PPPPrrrriiiinnnntttt JJJJoooobbbb HHHHaaaannnnddddlllliiiinnnngggg
SLSubmitJob
SLSubmitJobFd
SLSubmitJobBuf
SLSubmitJobSimple
SLCancelJob
PPPPrrrriiiinnnntttteeeerrrr QQQQuuuueeeeuuuueeee IIIInnnnffffoooorrrrmmmmaaaattttiiiioooonnnn
SLGetQueue
PPPPrrrriiiinnnntttteeeerrrr QQQQuuuueeeeuuuueeee CCCCoooonnnnttttrrrroooollll
SLSetSpoolerState
SLGetSpoolerState
EEEExxxxeeeeccccuuuuttttiiiioooonnnn EEEErrrrrrrroooorrrr HHHHaaaannnnddddlllliiiinnnngggg
SLPerror
SLGetSpoolerError
PPPPaaaaggggeeee 1111
LLLLIIIIBBBBSSSSPPPPOOOOOOOOLLLL((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo LLLLIIIIBBBBSSSSPPPPOOOOOOOOLLLL((((3333))))
AAAARRRRCCCCHHHHIIIITTTTEEEECCCCTTTTUUUURRRREEEE
Many of the _l_i_b_s_p_o_o_l functions rely on the System V or BSD spooling
system shell-level commands to accomplish the actual spooling system
work. The architecture of the library is depicted below.
User Program
|
libspool
|
System V ___ BSD
Spooling Commands Spooling Commands
DDDDEEEEBBBBUUUUGGGGGGGGIIIINNNNGGGG
If the global variable _S_L_d_e_b_u_g is set to a non-zero value, _l_i_b_s_p_o_o_l will
print debugging information to standard error during execution. The
global _S_L_d_e_b_u_g is declared in the header file _s_p_o_o_l._h.
SSSSIIIIGGGGNNNNAAAALLLL HHHHAAAANNNNDDDDLLLLIIIINNNNGGGG ((((SSSSIIIIGGGGCCCCLLLLDDDD))))
A number of _l_i_b_s_p_o_o_l functions spawn child processes to accomplish their
tasks. The child processes are executed in a blocking fashion whereby the
parent waits for the child to complete its processing. During the
execution of a child process, _l_i_b_s_p_o_o_l explicitly ignores the SSSSIIIIGGGGCCCCLLLLDDDD
signal. Following execution of the child, the library restores the
original SSSSIIIIGGGGCCCCLLLLDDDD handling. The library uses the PPPPOOOOSSSSIIIIXXXX signal handling
function _s_i_g_a_c_t_i_o_n(_2) to set the state of signal handling. Code that
links with _l_i_b_s_p_o_o_l that must catch the SSSSIIIIGGGGCCCCLLLLDDDD signal should use the
PPPPOOOOSSSSIIIIXXXX signal handling functions to avoid conflicts between signal
handling mechanisms.
NNNNEEEETTTTWWWWOOOORRRRKKKK OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNNSSSS
Certain _l_i_b_s_p_o_o_l functions obtain information about network printers by
executing remote commands. It may be impossible for _l_i_b_s_p_o_o_l to obtain a
connection to the remote machine (remote machine is down, network is not
reachable, etc.). In this case the _l_i_b_s_p_o_o_l function will timeout and
return an error code. The timeout period, in seconds, is specified by the
global variable _S_L_n_e_t__t_i_m_e_o_u_t. The default timeout period is specified by
the value of SSSSLLLL____NNNNEEEETTTT____TTTTIIIIMMMMEEEEOOOOUUUUTTTT in _s_p_o_o_l._h.
SSSSEEEEEEEE AAAALLLLSSSSOOOO
lp(1), lpr(1), sigaction(2)
PPPPaaaaggggeeee 2222